package com.generic.test01;

/**
 * @author bin
 * @date 2025 - 03 -25
 **/
public class People<P> {
    /**
     * 宠物
     * */
    private P pet;

    public People() {
    }

    public People(P pet) {
        this.pet = pet;
    }

    public P getPet() {
        return pet;
    }

    public void setPet(P pet) {
        this.pet = pet;
    }

    public void shopping(){
        System.out.println("逛街");
        //1、强转
        if(pet instanceof Animal a){
            a.call();
        }
        //2、设置边界

        //3、反射
    }
}
